package com.songcha.module_login.ui.activity.user_privacy

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.songcha.library_base.base.BaseActivity
import com.songcha.library_common.ui.view.HeaderBarView
import com.songcha.module_login.R
import com.songcha.module_login.ui.fragment.user_privacy.PrivacyPolicyFragment
import com.songcha.module_login.ui.fragment.user_protocol.UserProtocolFragment

@Deprecated("no use")
@Route(path="/login/UserPrivacyActivity")
class UserPrivacyActivity:BaseActivity() {
    private var mIsPrivacy=false

    override fun getLayoutId(): Int {
        return R.layout.login_activity_user_privacy
    }

    override fun isCalculateHearBarHeight(): Boolean {
        return true
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)

        intent?.let {
            mIsPrivacy=it.getBooleanExtra("is_privacy",false)
        }

        val hbv=findViewById<HeaderBarView>(R.id.login_hbv)

        if(mIsPrivacy){
            hbv.setTitle("隐私政策")
            val trans=supportFragmentManager.beginTransaction()
            trans.replace(R.id.login_frag,PrivacyPolicyFragment()).commit()
        }else{
            val trans=supportFragmentManager.beginTransaction()
            trans.replace(R.id.login_frag, UserProtocolFragment()).commit()
            hbv.setTitle("用户协议")
        }
    }


}